package cn.itcast.feign.client;


import cn.itcast.feign.client.fallback.UserClientFallbackFactory;
import cn.itcast.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//注解代表 当前接口为feign客户端
@FeignClient(value = "userservice",fallbackFactory = UserClientFallbackFactory.class)  //要调用的微服务名称
public interface UserClient {
    @GetMapping("/user/{id}")
    User findById(@PathVariable("id") Long id);
}
